package ms.unicorn.dsl.analysis;

import java.util.Collection;

import ms.unicorn.Element;

public interface AnalysisRegistryService {
	
	public interface AnalysisRegistryListener {
		public static final int ANALYSIS_REGISTERED = 0;
		public static final int ANALYSIS_UNREGISTERED = 1;
		public static final int ANALYSIS_CLEAR = 2;
		public static final int ANALYSIS_CHANGED = 3;
		public static final int ANALYSIS_ACTIVATED = 4;
		public static final int ANALYSIS_DEACTIVATED = 5;
		
		void analysisChanged(int what, IAnalysis changed);
	}
	
	Collection<IAnalysis> getAnalyses(Class<?> analysisType);
	
	Collection<IAnalysis> getAnalyses(Element element);
	
	IAnalysis getAnalysis(Class<?> analysisType, Element element);
	
	void registerAnalysis(IAnalysis analysis);
	
	void unregisterAnalysis(IAnalysis analysis);
	
	void notify(int what, IAnalysis analysis);

	void clearAll();
	
	public void registerListener(AnalysisRegistryListener listener);
	
	public void unregisterListener(AnalysisRegistryListener listener);
}
